#pragma once
#include "BeaconInterface.h"
#include "LocatorWrapper.h"
#include <string>
#include <vector>
using namespace easyshow;
using namespace std;
std::vector<BeaconData> tempdata;

void InitBeaconConfig(string infopath)
{
	LocatorWrapper::LocaterWrapperInstance()->init(infopath,true);
}


void BeginSendBeaconData()
{
	tempdata.clear();
}

void SendBeaconData(string beaconId, float beaconDistance)
{
	BeaconData data;
	data.beaconAddress = beaconId;
	data.distance = beaconDistance;
	tempdata.push_back(data);	
}


void EndSendBeaconData()
{
	LocatorWrapper::LocaterWrapperInstance()->PushLocationData(tempdata);
}

string GetBeaconLocation()
{
	bool get;
	UserPos pos = LocatorWrapper::LocaterWrapperInstance()->PopLocationData(get);
	string result = "";
	if (get)
	{
		LOGI("final result posx is %f,posy is %f ,mapid is %d", pos.pos_x, pos.pos_y, pos.map_id);
		result = std::to_string(pos.pos_x) + ";" + std::to_string(pos.pos_y) + ";" + std::to_string(pos.map_id);
	}
	return result;
}

